import java.util.List;


public class Book {
		
	public String bookName;
	private Library library;
	private Author author;
	private List relatedWorks;
	
	public Book(String bookName, Library library)
	{
		this.bookName = bookName;
		this.library = library;
		this.author = new Author("John");
		relatedWorks.add(new RelatedWork("Some related work", author));
	}
	
	public Library GetBookLibrary()
	{
		return this.library;
	}
	
	public void SetAuthor(Author author)
	{
		this.author = author;
		for (Object relWork : relatedWorks)
		((RelatedWork)relWork).DoInnerStuff();
	}
	
	// Inner class.
	public class RelatedWork
	{
		String workName;
		Author workAuthor;
		
		public RelatedWork(String workName, Author workAuthor)
		{
			this.workName = workName;
			this.workAuthor = workAuthor;
		}
		
		public void DoInnerStuff()
		{
			workAuthor.Authorize(this);
		}
	}
	
}
